package app.web.qk.controller;

import app.web.qk.domain.vo.QkLogVo;
import app.web.qk.service.QkLogService;
import com.gitee.feizns.quickstart.domain.page.PageRecordsVo;
import com.gitee.feizns.quickstart.domain.vo.Ret;
import com.gitee.feizns.quickstart.log.Log;
import com.gitee.feizns.quickstart.log.spring.boot.autoconfigure.db.mybatis.flex.pojo.QkLog;
import com.gitee.feizns.quickstart.web.domain.query.QueryParamsAo;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通用模块/日志管理
 * @author feizns
 * @since 2025/4/10
 * @since 2025/8/5
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/qk/log")
public class QkLogController {

    /**
     * 服务
     */
    private final QkLogService service;

    /**
     * 查询日志
     * @param ao 请求参数
     * @return {@link Ret }<{@link PageRecordsVo }<{@link QkLog }>>
     */
    @Log(type = "通用模块", value = "'获取日志列表'")
    @GetMapping
    public Ret<PageRecordsVo<QkLogVo>> page(QueryParamsAo ao) {
        return Ret.ok(service.page(ao));
    }

}
